var huizongbiao = new Vue({
    el : '#Huizongbiaolist',
    data:{
        xiangmuId : $("#xiangmuId").val(),
        xiangmu : {},
        HuizongbiaoList : [],
        show : false,
        total:0,

    },
    created : function() {
        var _this = this;

        $(".nav navbar-nav li").removeClass("active");
        $("#nav_huizongbiao").addClass("active");
        _this.bindHuizongbiaoList();
        _this.bindXiangmu();
    },
    methods : {



        bindXiangmu:function (){
            var _this = this;
            layer.open({type:3});
            $.post('/xiangmu/find_one', {
                xianmguid : _this.xiangmuId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        var data = ppData.resultContent;
                        _this.xiangmu = data;
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },

        bindHuizongbiaoList:function (){
            var _this = this;
            layer.open({type:3});
            $.post("/xinguotanjieguo/findHuizongbiaolist",{
                xiangmuid : _this.xiangmuId,

                rdm : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if (ppData != null){
                    if(ppData.result == "1"){
                        var data=ppData.resultContent;
                        var mmHtml = "<div class='table-head'><table class=\"table table-hover table-bordered\" style=\"overflow:hidden; margin-bottom:10px;table-layout:fixed;\"  v-if=\"show\" cellspacing=\"0\" cellpadding=\"0\">\n" +
                            "   <thead >\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:50px;\" >排名</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:40px;\" >序号</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:140px;\" >药品名称</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:50px;\" >医保</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:50px;\" >院本部药</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:50px;\" >秦淮药</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >专科分组</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >申请科室</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:300px\" >国家平台备注信息</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px\" >规格1</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px\" >规格2</th>\n" +
                            "       <th style=\"text-align:center;vertical-align:middle;width:100px;\" >委员表决票数(同意数/总票数)</th>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:100px;\" >表决结果</td>\n" +
                            "    </thead></table></div><div class='table-body'><table style=\"table-layout: fixed;\"><tbody>";
                        if(data.HuizongbiaoList.length > 0){
                            _this.show = true;
                            _this.huizongbiaolist=data.HuizongbiaoList;
                            for (var i = 0; i < _this.huizongbiaolist.length; i++) {
                                var mmXinguotanOne = _this.huizongbiaolist[i];
                                var mmResult=mmXinguotanOne.result;
                                var mmId=mmXinguotanOne.id;

                                var mmpaixuhao = mmXinguotanOne.ordernumber;
                                var mmyaowumingcheng = mmXinguotanOne.yaopinmingcheng;
                                var mmyibao = mmXinguotanOne.yibao;
                                var mmyuanbenbuyao = mmXinguotanOne.yuanbenbuyao;
                                var mmqinhuaiyao = mmXinguotanOne.qinhuaiyao;
                                var mmzhuankefenzu = mmXinguotanOne.zhuankefenzu;
                                var mmshenqingkeshi = mmXinguotanOne.shenqingkeshi;
                                var mmbeizhu = mmXinguotanOne.beizhu;
                                var mmbeizhu2 = mmXinguotanOne.beizhu2;
                                var mmbeizhu3 = mmXinguotanOne.beizhu3;
                                var mmpiaoshu = mmXinguotanOne.piaoshu;
                                var mmjieguo=mmXinguotanOne.jieguo;
                                var mmpaixu = i+1;

                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmpaixu + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:40px;'>" + mmpaixuhao + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:140px;'>" + mmyaowumingcheng + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmyibao + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmyuanbenbuyao + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmqinhuaiyao + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmzhuankefenzu + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmshenqingkeshi + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:300px; white-space:nowrap; -moz-text-overflow: ellipsis;text-overflow: ellipsis; overflow: hidden; text-align: left'><a title='" + mmbeizhu + "'>" + mmbeizhu + "</a></td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;white-space:nowrap; -moz-text-overflow: ellipsis;text-overflow: ellipsis; overflow: hidden;'><a title='" + mmbeizhu2 + "'>" + mmbeizhu2 + "</a></td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px'>" + mmbeizhu3 + "</td>";
                                mmHtml +="<td style='text-align:center;vertical-align:middle;width: 100px;height: 100%'>" + mmpiaoshu + "</td>";
                                if(mmjieguo=='通过'){
                                    mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;color: green'>" + mmjieguo + "</td>";
                                }else {
                                    mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;color: red'>" + mmjieguo + "</td>";
                                }
                                mmHtml += "</tr>";

                            }



                        }else {
                            _this.show = false;
                        }
                        mmHtml += "</table>";
                        $("#List").html(mmHtml);
                    }else{
                        layer.alert(ppData.message);
                    }
                }

            },"json");
        },



    },
    watch :{
        //监控分页情况，刷新列表
        pageIndex : function(){

            this.bindHuizongbiaoList();
        }
    }
})